#include "EditWidget.h"
#include "ui_EditWidget.h"

#include <QDateTime>

EditWidget::EditWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::EditWidget)
    ,m_clockTimer(new QTimer(this))
{
    ui->setupUi(this);

    connect(m_clockTimer, &QTimer::timeout, this, &EditWidget::slotClockTimer);
    m_clockTimer->start(500);
}

EditWidget::~EditWidget()
{
    delete ui;
}

void EditWidget::slotClockTimer()
{
    QString currentTime = QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss");
    ui->edtTime->setText(currentTime);
}
